BEGIN {
  #print "start acc budget log"
  lastAcc = 0
  lastMatch = 0
  accMatchSum = 0
}
length($0) > 0 {
  #printf("$1:%d\t$3:%d\t$4:%d\n", $1, $3, $4)
  if ($1 == lastAcc && $3 == lastMatch) {
    accMatchSum = accMatchSum + $4 
    #printf("if ture accMatchSum:%d\n", accMatchSum)
  } else {
    #printf("if false accMatchSum:%d\n", accMatchSum)
    if (accMatchSum != 0) {
      printf("%d\t%d\t%d\n", lastAcc, lastMatch, accMatchSum)
    }
    lastAcc = $1
    lastMatch = $3
    accMatchSum = $4
  }
  #printf("%s\t%s\t%s\t%s\n", $1, $4, $6, $9)
}
END {
  printf("%d\t%d\t%d\n", lastAcc, lastMatch, accMatchSum)
}
